UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jeiI6CBh6oeMu2BTinYUGA61peUy5t78EMdI0W1fMaU='
WHERE
key_id = '710f153e55efc03be4c4e430e4036653fbdaccc80cee00dcd02f88b3f1de1aeb'
AND (
token = 'jeiI6CBh6oeMu2BTinYUGA61peUy5t78EMdI0W1fMaU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)