UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ggeae21gOw9+SwR/xUXxGgw41p8d07cA62bomoWobns='
WHERE
key_id = 'f1349c7c14eb8d2be7e1c83dbafc093c31dbe7aada42dbfbbe2943f14483c0c1'
AND (
token = 'ggeae21gOw9+SwR/xUXxGgw41p8d07cA62bomoWobns='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)