UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zIBs8et9a7XB+DKOsM9MTrxgG9iOX5LXN0jSFBI4UJU=' 
WHERE 
  key_id = '485db7f50e751d60a01a3a21201e33d0ab5f12cd409eb6be78b791b2336ff990' 
  AND (
    token = 'zIBs8et9a7XB+DKOsM9MTrxgG9iOX5LXN0jSFBI4UJU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023