UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OrBWEOazanksyWFlIz8+ym/0u+Vne8qhjzwPSDAgDoI='
WHERE
key_id = 'b0e480d556fe1cac7e142755fab59abd05925424af2dfb787d0b71e06bfa04b1'
AND (
token = 'OrBWEOazanksyWFlIz8+ym/0u+Vne8qhjzwPSDAgDoI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)