UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Pa7GLRPUlGXg5uUN0bqTB2SmTAzgofzaHY3mG11sTHg=' 
WHERE 
  key_id = 'dd5b01dab4b3769f2692649468ba3f992bcc50ca2f5d57931055a121b31eca38' 
  AND (
    token = 'Pa7GLRPUlGXg5uUN0bqTB2SmTAzgofzaHY3mG11sTHg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046