UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mARgdEbCG258f4DpOTrmRdCIiy3tArLYOuXeqzjiJMc='
WHERE
key_id = 'ebc1e82610bd49fa2d89256018d8972ccce7056b1ed2917f46e7de44930cbd81'
AND (
token = 'mARgdEbCG258f4DpOTrmRdCIiy3tArLYOuXeqzjiJMc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)