UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FmSoy+57iy6mwDPkxoJL3uRKCdzAugbH4U7jIwM/Jww='
WHERE
key_id = '7964a16c829d4c69943d7963dba9bd4898b2eca7a0b5b088e2c3891784fdf39c'
AND (
token = 'FmSoy+57iy6mwDPkxoJL3uRKCdzAugbH4U7jIwM/Jww='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)