UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lZeI+hi4lvEqpWnw6sRd8y6jk783fn5jjugMBstyjxQ='
WHERE
key_id = '693f2c456066722321af98dbc8431dca2d7f832aaa3e90e85ef8f9a2661a9fbe'
AND (
token = 'lZeI+hi4lvEqpWnw6sRd8y6jk783fn5jjugMBstyjxQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)