UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'umCWPHheawrzfel9/hIYuoqsIYn+NCmovoMkjXDSTIs='
WHERE
key_id = '71665eec83fc76a8651305abc494dc4741547677f203825e8cff41df088fd58e'
AND (
token = 'umCWPHheawrzfel9/hIYuoqsIYn+NCmovoMkjXDSTIs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)