UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'swWN4bQlXbD6Lp5uyMV+F7kst+9wVTC5eEtx0PEjGOI=' 
WHERE 
  key_id = '7563308df036041b73e4bbf3aef2c442bb6431d557c2525484956d53d312882a' 
  AND (
    token = 'swWN4bQlXbD6Lp5uyMV+F7kst+9wVTC5eEtx0PEjGOI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018