UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pkmM24Ai0UAU66iyvHqP2Ef9f+rmnlV6JTQvgYO6GyA='
WHERE
key_id = 'bbd7cb8ed6ac5f63d39ae27838a21eda13894a901308b986c49c50db5ff80296'
AND (
token = 'pkmM24Ai0UAU66iyvHqP2Ef9f+rmnlV6JTQvgYO6GyA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)