UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1h7f5K3pJQ7gEmRQhnnrPrAgmadDfq1ECc98UYJaEwk=' 
WHERE 
  key_id = '430736a7f5e7f6224a9d9a4ed572bda853a4953f1bc6c2167d68a77d28f8d252' 
  AND (
    token = '1h7f5K3pJQ7gEmRQhnnrPrAgmadDfq1ECc98UYJaEwk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027