UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H2xYALFgQNhQ1527pHBgKdlkE57JN8m/mnFjokTa9DI='
WHERE
key_id = '0d10d469ba24bfd0a5ac34c6d3ca1aa92cb00425888c7ead10db6778fdd77323'
AND (
token = 'H2xYALFgQNhQ1527pHBgKdlkE57JN8m/mnFjokTa9DI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)