UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qFDGva0JyJdzZd1WgNGJNx81wLFiLXirn5Wl9WCV7T0='
WHERE
key_id = 'c8f00f934ac6d81dff9cb5a27dcc0a067bdb5d0e50ddb4c2d7f12009dc9c532d'
AND (
token = 'qFDGva0JyJdzZd1WgNGJNx81wLFiLXirn5Wl9WCV7T0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)