UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'K2bO2xgyZ5q6h9/ZzuIDxBjuDJT6AYR8mk33vprI7i0=' 
WHERE 
  key_id = 'b94ee0871346175743bbc0414b898e85adbe34ad8a497695e7d50a0142b7d98a' 
  AND (
    token = 'K2bO2xgyZ5q6h9/ZzuIDxBjuDJT6AYR8mk33vprI7i0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033