UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2Q/DjAWqBXE+0apPsH2WbzX7Xghqfj8xKfvU7PEA1qE='
WHERE
key_id = '8d01cfeb25cb32af884c1f692463aa2f87620d06fc4809644fbb2589a568a6b9'
AND (
token = '2Q/DjAWqBXE+0apPsH2WbzX7Xghqfj8xKfvU7PEA1qE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)