UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7wq6IlzVmgKJJesKaxi/MRq2J2DxEmRAwOpfFWfjQr0=' 
WHERE 
  key_id = '4d8a6dc717448c6f4358cc65173d58656df89b8f21675a21f2a1955dba284c55' 
  AND (
    token = '7wq6IlzVmgKJJesKaxi/MRq2J2DxEmRAwOpfFWfjQr0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045