UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GJV34fYUiXnf/owpKk2ATDqYAbWAsd+rPGTko/Smldg='
WHERE
key_id = '4eab64f8d0358bed3d09ed18d0c4ab44927204d09809ea621a3283b646fbc938'
AND (
token = 'GJV34fYUiXnf/owpKk2ATDqYAbWAsd+rPGTko/Smldg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)