UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NPzTr981P3hI7SNV1/2nE0IK7tGu2XduOPse2sKI240='
WHERE
key_id = 'e1e214d5053bf6c462a247d13c99a8dc5b1e41b9307d7b92cff12be19b9d5ef8'
AND (
token = 'NPzTr981P3hI7SNV1/2nE0IK7tGu2XduOPse2sKI240='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)