UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UznrZlmU+UDJvizgvC5GS2+dTQV2BuLnJAbg3fwgVwI=' 
WHERE 
  key_id = '9a02805d1aef3ab2e5f2cc2407c0b43dd0ef8642472589ccaac7099334b05eab' 
  AND (
    token = 'UznrZlmU+UDJvizgvC5GS2+dTQV2BuLnJAbg3fwgVwI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015