UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QQgl/ZGXxvFKv9/bzShjiIcsHIIsNzMd5esxK4YMQ9w='
WHERE
key_id = 'fd91152ec87c70826c38cbfd3e8c7f532862978d1f5585ffa37c2ca00c904567'
AND (
token = 'QQgl/ZGXxvFKv9/bzShjiIcsHIIsNzMd5esxK4YMQ9w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)