UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7/aDjGZah3a6RnxuSNplYL1ay1I5Ur3XrVtmXqR2NTU='
WHERE
key_id = '87e12838f2327eded0374f7ca98aff7d865f8faae721a34ca6d4c64657b60f17'
AND (
token = '7/aDjGZah3a6RnxuSNplYL1ay1I5Ur3XrVtmXqR2NTU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)