UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VmHuMQBfglKmUylRTn8WWZMDeMZI8rDRcqk5PIaSe4o='
WHERE
key_id = '4194ce60aa7e71b1e380cbec530ed62e4c41a7ea6b526e75a7195d803ecc1dca'
AND (
token = 'VmHuMQBfglKmUylRTn8WWZMDeMZI8rDRcqk5PIaSe4o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)