UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ewEBU6ldJKecMtQLSopkJZVYJmCL4An2HJu89MS/gDE=' 
WHERE 
  key_id = '47f852526d4c6275787e575e78e7a912ede663f8fd911d8e3af9c65d44ecca86' 
  AND (
    token = 'ewEBU6ldJKecMtQLSopkJZVYJmCL4An2HJu89MS/gDE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047