UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jbFVxaDBe8qQpcmRGdNVwv+x0ZRNweflG+wwc8X//3c=' 
WHERE 
  key_id = '53a00d4a88f3db692bce2c163c4c173e3c7c96a72c16111034b6f8900f085469' 
  AND (
    token = 'jbFVxaDBe8qQpcmRGdNVwv+x0ZRNweflG+wwc8X//3c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029