UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u1sldgkdRRI4rEgCfajHv4pX0RnT4+3XSqlxaj8gZ8g='
WHERE
key_id = 'a0330ccbf3f94e6e9a7d513effd335ff4522227cf0969f4cb6427b6d88e5e876'
AND (
token = 'u1sldgkdRRI4rEgCfajHv4pX0RnT4+3XSqlxaj8gZ8g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)