UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XSiz4d8ZPrrt3+Z8hHCLG2CCtrCA9b4Wwfv0Mpcg/qQ=' 
WHERE 
  key_id = 'e984a14074f6ac82455d1e7e9b531d3b4250b1e03ee0d75df28095c1bdfc38c1' 
  AND (
    token = 'XSiz4d8ZPrrt3+Z8hHCLG2CCtrCA9b4Wwfv0Mpcg/qQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033