UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RhulxmD2Wu8BwfDti6c3WpY7L6xlr5kSffXujbI8hn8='
WHERE
key_id = '2a4306c643a2c556c49d790b906fb097da91e2fa170bbdf2c942c481a81da447'
AND (
token = 'RhulxmD2Wu8BwfDti6c3WpY7L6xlr5kSffXujbI8hn8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)